#!/bin/bash
# 方法四：使用完整 MySQL 客户端安装

echo "方法四：安装完整的 MySQL/MariaDB 客户端和开发库..."

# Anolis OS 8.4 / RHEL 8
sudo dnf install -y \
    mariadb-server \
    mariadb-devel \
    mysql-community-devel \
    mysql-community-client \
    gcc \
    gcc-c++ \
    make \
    python3-devel \
    pkgconfig \
    openssl-devel \
    libffi-devel \
    zlib-devel

# 验证安装
echo ""
echo "验证安装结果:"
pkg-config --modversion mariadb 2>/dev/null && echo "✓ MariaDB 开发库已安装" || echo "✗ MariaDB 开发库未找到"
pkg-config --modversion mysqlclient 2>/dev/null && echo "✓ MySQL 客户端库已安装" || echo "✗ MySQL 客户端库未找到"

echo ""
echo "现在可以安装 mysqlclient:"
echo "source venv/bin/activate"
echo "pip install mysqlclient"

